<template>
  <div class="Home">
      <el-container class="home-container">
        <!-- 头部区域 -->
        <el-header>
            <div class="headTiele">代理系统后台</div>
            <div class="headNav" v-if="this.isAdimn == 'true'">
                <router-link to="/Homecontent">首页</router-link>
                <router-link to="/Usermanage">会员管理</router-link>
                <router-link to="/Public">公众号</router-link>
                <router-link to="/Price">价格/分成</router-link>
                <router-link to="/Income">收益/提现</router-link>
            </div>
            <div class="headNav" v-else>
                <router-link to="/Usercontent">首页</router-link>
                <router-link to="/Public">公众号</router-link>
                <router-link to="/Price">价格/分成</router-link>
                <router-link to="/Income">收益/提现</router-link>
            </div>
            <div class="headUser">
                <span>您好，{{username}}</span>
                <span @click="outLogin">退出登录</span>
            </div>
        </el-header>
        <el-main><router-view/></el-main>

      </el-container>
  </div>
</template>

<script>
export default {
    data() {
      return {
        username:'',
        isAdimn:''
      }
    },
    methods:{
      outLogin(){
          this.$cookie.delete('token')
          this.$cookie.delete('isAdimn')
          this.$cookie.delete('username')
          this.$router.push('/Login')
      }
    },
    created(){
        this.isAdimn = window.atob(this.$cookie.get('isAdimn'));
		    this.username = this.$cookie.get('username');
    }
}
</script>
<style scoped>
    .el-header{
        background-color: #1870ff;
        display: flex;
        align-items: center;
    }
    .headTiele{
      color: #fff;
      margin-right: 120px;
	  min-width: 120px;
    }
    .headNav{
      display: flex;
      align-items: center;
      text-align: center;
      flex: 1;
      height: 100%;
    }
    .headNav>a{
      color: #aad6ff;
      text-decoration: none;
      width: 100px;
      height: 100%;
      line-height: 60px;
    }
    .headNav .router-link-active{
      color: #fff;
    }
    .headUser>span{
        font-size: 14px;
        color: #fff;
        margin-left: 32px;
        cursor: pointer;
    }
    .el-main{
      padding: 0;
      background-color: #ededed;
    }
</style>